package cn.xingzhe.monster.user.domain.exception;

/**
 * 角色不存在异常
 *
 * @author System
 * @version 1.0.0
 * @since 2024-01-01
 */
public class RoleNotFoundException extends UserException {

    private static final String ERROR_CODE = "A0203";
    private static final String DEFAULT_MESSAGE = "角色不存在";

    /**
     * 构造函数
     */
    public RoleNotFoundException() {
        super(ERROR_CODE, DEFAULT_MESSAGE);
    }

    /**
     * 构造函数
     *
     * @param message 错误消息
     */
    public RoleNotFoundException(String message) {
        super(ERROR_CODE, message);
    }

    /**
     * 创建角色不存在异常
     *
     * @param roleId 角色ID
     * @return RoleNotFoundException
     */
    public static RoleNotFoundException byId(String roleId) {
        return new RoleNotFoundException("角色不存在，ID: " + roleId);
    }
}

